package com.xiweicheng.test.jpa.entity;
// Generated 2018-7-13 22:08:49 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

/**
 * Channel generated by hbm2java
 */
@Entity
@Table(name = "channel", catalog = "tms", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class Channel implements java.io.Serializable {

	private Long id;
	private long version;
	private Users usersByOwner;
	private Users usersByCreator;
	private Users usersByUpdater;
	private Date createDate;
	private String description;
	private String name;
	private Boolean privated;
	private String status;
	private String title;
	private String type;
	private Date updateDate;
	private Set<ChatPin> chatPins = new HashSet<ChatPin>(0);
	private Set<Users> userses = new HashSet<Users>(0);
	private Set<ChannelGroup> channelGroups = new HashSet<ChannelGroup>(0);
	private Set<SpaceAuthority> spaceAuthorities = new HashSet<SpaceAuthority>(0);
	private Set<ChatChannel> chatChannels = new HashSet<ChatChannel>(0);
	private Set<Users> userses_1 = new HashSet<Users>(0);
	private Set<BlogAuthority> blogAuthorities = new HashSet<BlogAuthority>(0);
	private Set<Schedule> schedules = new HashSet<Schedule>(0);

	public Channel() {
	}

	public Channel(String name, String status) {
		this.name = name;
		this.status = status;
	}

	public Channel(Users usersByOwner, Users usersByCreator, Users usersByUpdater, Date createDate, String description,
			String name, Boolean privated, String status, String title, String type, Date updateDate,
			Set<ChatPin> chatPins, Set<Users> userses, Set<ChannelGroup> channelGroups,
			Set<SpaceAuthority> spaceAuthorities, Set<ChatChannel> chatChannels, Set<Users> userses_1,
			Set<BlogAuthority> blogAuthorities, Set<Schedule> schedules) {
		this.usersByOwner = usersByOwner;
		this.usersByCreator = usersByCreator;
		this.usersByUpdater = usersByUpdater;
		this.createDate = createDate;
		this.description = description;
		this.name = name;
		this.privated = privated;
		this.status = status;
		this.title = title;
		this.type = type;
		this.updateDate = updateDate;
		this.chatPins = chatPins;
		this.userses = userses;
		this.channelGroups = channelGroups;
		this.spaceAuthorities = spaceAuthorities;
		this.chatChannels = chatChannels;
		this.userses_1 = userses_1;
		this.blogAuthorities = blogAuthorities;
		this.schedules = schedules;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "owner")
	public Users getUsersByOwner() {
		return this.usersByOwner;
	}

	public void setUsersByOwner(Users usersByOwner) {
		this.usersByOwner = usersByOwner;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator")
	public Users getUsersByCreator() {
		return this.usersByCreator;
	}

	public void setUsersByCreator(Users usersByCreator) {
		this.usersByCreator = usersByCreator;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updater")
	public Users getUsersByUpdater() {
		return this.usersByUpdater;
	}

	public void setUsersByUpdater(Users usersByUpdater) {
		this.usersByUpdater = usersByUpdater;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "description", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "name", unique = true, nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "privated")
	public Boolean getPrivated() {
		return this.privated;
	}

	public void setPrivated(Boolean privated) {
		this.privated = privated;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "title")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set<ChatPin> getChatPins() {
		return this.chatPins;
	}

	public void setChatPins(Set<ChatPin> chatPins) {
		this.chatPins = chatPins;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "member_channel", catalog = "tms", joinColumns = {
			@JoinColumn(name = "channel_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<Users> getUserses() {
		return this.userses;
	}

	public void setUserses(Set<Users> userses) {
		this.userses = userses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set<ChannelGroup> getChannelGroups() {
		return this.channelGroups;
	}

	public void setChannelGroups(Set<ChannelGroup> channelGroups) {
		this.channelGroups = channelGroups;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set<SpaceAuthority> getSpaceAuthorities() {
		return this.spaceAuthorities;
	}

	public void setSpaceAuthorities(Set<SpaceAuthority> spaceAuthorities) {
		this.spaceAuthorities = spaceAuthorities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set<ChatChannel> getChatChannels() {
		return this.chatChannels;
	}

	public void setChatChannels(Set<ChatChannel> chatChannels) {
		this.chatChannels = chatChannels;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "subscriber_channel", catalog = "tms", joinColumns = {
			@JoinColumn(name = "channel_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<Users> getUserses_1() {
		return this.userses_1;
	}

	public void setUserses_1(Set<Users> userses_1) {
		this.userses_1 = userses_1;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set<BlogAuthority> getBlogAuthorities() {
		return this.blogAuthorities;
	}

	public void setBlogAuthorities(Set<BlogAuthority> blogAuthorities) {
		this.blogAuthorities = blogAuthorities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set<Schedule> getSchedules() {
		return this.schedules;
	}

	public void setSchedules(Set<Schedule> schedules) {
		this.schedules = schedules;
	}

}
